package com.shqcjd.generalplatformprojectclient.ui.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shqcjd.generalplatformprojectclient.R;
import com.shqcjd.generalplatformprojectclient.model.pojo.StaffsBean;
import com.shqcjd.generalplatformprojectclient.util.DateUtil;

import java.util.List;

/**
 * 员工列表
 * Created by sy on 2018/12/15.
 */

public class StaffsListAdapter extends BaseQuickAdapter<StaffsBean,BaseViewHolder> {
    public StaffsListAdapter(@Nullable List<StaffsBean> data) {
        super(R.layout.item_staffs_list, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, StaffsBean item) {
        helper.setText(R.id.tv_name,item.name)
                .setText(R.id.tv_number,item.phoneNumber)
                .setText(R.id.tv_add_date, DateUtil.getDateToString(item.createTime,"添加时间: yyyy-MM-dd HH:mm:ss"))
                .addOnClickListener(R.id.tv_edit_btn)
                .addOnClickListener(R.id.tv_del_btn);
    }
}
